//
//  recommendModel.m
//  Focus
//
//  Created by dlios on 14-10-28.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "recommendModel.h"

@implementation recommendModel
-(void)dealloc{
    [_title release];
    [_date release];
    [_authername release];
    [_weburl release];
    [_titlelinebreak release];
    [_fullurl release];
    [_specialinfo release];
    [super dealloc];
}
-(id)initWithDic:(NSDictionary *)dic{
    if (self == [super init]) {
        self.title = [dic objectForKey:@"title"];
        self.date = [dic objectForKey:@"date"];
        self.authername = [dic objectForKey:@"auther_name"];
        self.weburl = [dic objectForKey:@"weburl"];
        self.titlelinebreak = [dic objectForKey:@"title_line_break"];
        self.fullurl = [dic objectForKey:@"full_url"];
        self.specialinfo = [[dic objectForKey:@"special_info"]objectForKey:@"icon_url"];
        self.imageCount = [dic objectForKey:@"media"];
        self.pk = [dic objectForKey:@"pk"];
        if ([[dic objectForKey:@"media"] count] == 3) {
            self.leftImage = [[[dic objectForKey:@"media"] objectAtIndex:0]objectForKey:@"raw_url"];
            self.minImage = [[[dic objectForKey:@"media"]objectAtIndex:1]objectForKey:@"raw_url"];
            self.rightImage = [[[dic objectForKey:@"media"]objectAtIndex:2]objectForKey:@"raw_url"];
            
        } else if ([[dic objectForKey:@"media"]count] == 1)
        {
            self.onceImage = [[[dic objectForKey:@"media"]objectAtIndex:0]objectForKey:@"raw_url"];
            
            
        }
        //        NSLog(@"%@",self.specialinfo);
    }
    
    return self;
}
@end
